/**
 * @author hugh
 * @time  2021-01-10 11:40
 * @title  入口文件
 * @desc
 */
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import i18n from './lang'
import * as Echart from 'echarts';
//组件库
import ElementPlus from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css'
import SvgIcon from './components/SvgIcon.vue'// svg component

import locale from 'element-plus/lib/locale/lang/zh-cn'

//工具
import {showDialog,showMsg,getTreeList,getCascader,subArray,setTreeList} from './utils'
import api from './common/api/index'

//公共css
import './styles/element-variables.scss'
import './styles/index.scss'
import './styles/grid.scss'

if(process.env.NODE_ENV === 'development'){
  require('./mock')
};
const app = createApp(App)
//全局挂载配置
app.config.globalProperties.$api = api; // 挂载服务
app.config.globalProperties.$echarts = Echart;
app.config.globalProperties.$dialog = showDialog;
app.config.globalProperties.$treeList = getTreeList;
app.config.globalProperties.$cascader = getCascader;
app.config.globalProperties.$msg = showMsg;
app.config.globalProperties.$subArray =subArray;
app.config.globalProperties.$setTreeList =setTreeList;
// register globally

app.component('svg-icon', SvgIcon)
app.use(ElementPlus,{
  locale,
  i18n: i18n.global.t
});

app.use(store);
app.use(i18n);
app.use(router);
app.mount('#app');
